package cn.ywsj.ywsjmidtier.controller;

import cn.ywsj.ywsjmidtier.entity.VO.AreaInfoLabelQueryVo;
import cn.ywsj.ywsjmidtier.entity.VO.AreaInfoLabelVo;
import cn.ywsj.ywsjmidtier.service.WechatAreaInfoLabelFeign;
import cn.ywsj.ywsjmidtier.utils.JsonObjectUtil;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : WechatAreaInfoLabelController
 * @Author : Lenovo
 * @Date: 2021/7/23 14:54
 * @Description :
 */
@RestController
@RequestMapping("/wechat/member/areainforlabelmgr")
public class WechatAreaInfoLabelController {
    @Autowired
    private WechatAreaInfoLabelFeign wechatAreaInfoLabelFeign;
    @GetMapping("/quaryareainfolabellist")
    public String quaryAreaInfoLabelList(AreaInfoLabelQueryVo areaInfoLabelQueryVo, BindingResult result) {
        JSONObject jsonObject = JsonObjectUtil.ObjectToJson(areaInfoLabelQueryVo);
        return wechatAreaInfoLabelFeign.quaryAreaInfoLabelList(jsonObject,result);
    }
    @PostMapping("/addareainfolabel")
    public String addAreaInfoLabel(AreaInfoLabelVo areaInfoLabelVo, BindingResult result) {
        JSONObject jsonObject = JsonObjectUtil.ObjectToJson(areaInfoLabelVo);
        return wechatAreaInfoLabelFeign.addAreaInfoLabel(jsonObject,result);
    }
    @GetMapping("/quaryoneareainfolabellist")
    public String quaryOneAreaInfoLabelList(AreaInfoLabelQueryVo areaInfoLabelQueryVo) {
        JSONObject jsonObject = JsonObjectUtil.ObjectToJson(areaInfoLabelQueryVo);
        return wechatAreaInfoLabelFeign.quaryOneAreaInfoLabelList(jsonObject);
    }
    @PostMapping("/deleteareainfolabel")
    public String deleteAreaInfoLabel(AreaInfoLabelVo areaInfoLabelVo)  {
        JSONObject jsonObject = JsonObjectUtil.ObjectToJson(areaInfoLabelVo);
        return wechatAreaInfoLabelFeign.deleteAreaInfoLabel(jsonObject);
    }
}
